﻿<%@ Page Language="C#" MasterPageFile="~/Shared/MainPage.Master" AutoEventWireup="true" CodeBehind="ContractDocument.aspx.cs" Inherits="Runda.CMS.Portal.Workspace.ContractDocument" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server">
    <script src="../Content/global.js" type="text/javascript"></script>
    <link href="../Content/Menu/Menu.css" rel="stylesheet" type="text/css" />
    <link href="../Content/Grid/Grid.css" rel="stylesheet" type="text/css" />
    <link href="../Content/global.css" rel="stylesheet" type="text/css" />
    <link href="../Content/Tab/tabs.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function CheckForm() {
            if (document.getElementById('<%=txtDocumentName.ClientID %>').value == '') {
                alert('请填写文档名称!');
                return false;
            }
        }

        function getids() {           
            var arrTr = grid.getSelected();
            if (arrTr.length > 0) {
                if (!confirm('确认删除此明细?')) {
                    return;
                }
                var ids = "";
                for (var i = 0; i < arrTr.length; i++) {
                    if (ids != "") {
                        ids += ";";
                    }
                    ids += arrTr[i].oid;
                }
                document.getElementById('<%=documentids.ClientID %>').value = ids;
                document.getElementById('<%=lnkbtnDelete.ClientID %>').click();
            }
        }     
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphBody" runat="server">

 <div class="area" id="areaForm" >
                    
    <div style="margin: 5px 0 5px 0">
    </div>
    <table class="mnubar" cellspacing="0" cellpadding="0" height="400px">
        <tbody>
            <tr>
                <td style="padding-left: 5px" nowrap>
                    <b>合同文档列表</b>
                </td>
                <td style="padding-left: 5px">
                    <img src="../Content/Grid/separator.gif">
                </td>
                <td class="icMenu" nowrap>
                      <span class="menu" tabindex="0" menu="appGridMenu_mainmnu">操作<img src="../Content/Grid/mnuDown.gif">
                            <table id="appGridMenu_mainmnu" class="mnuList" cellspacing="0" cellpadding="3">
                                <colgroup>
                                    <col class="mnuLeft">
                                    <col class="mnuItm">
                                    <col align="right" width="20">
                                    <tbody>
                                        <tr tabindex="0"  action="getids()">
                                            <td>
                                            </td>
                                            <td colspan="2" nowrap>
                                                 <asp:LinkButton ID="lnkbtnDelete" runat="server" OnClick="delete">删除</asp:LinkButton><input type="hidden" runat="server" id="documentids" />
                                            </td>
                                        </tr>
                                    </tbody>
                            </table>
                        </span>
                </td>
                <td class="icMenu mnuRight" nowrap>
                </td>
            </tr>
        </tbody>
    </table>
    <div style="border-bottom: #c2c2bf 1px solid; border-top: #969693 1px solid">
    </div>
        <asp:Repeater ID="RepeaterDocuments" runat="server" 
                        onitemcommand="RepeaterDocuments_ItemCommand">
            <HeaderTemplate>
                <table id="grid" class="grid" cellspacing="0" cellpadding="0">
                    <tbody>
                        <tr class="header">
                            <td align="middle">
                                <div>
                                    <div style="display: inline; float: left; height: auto; overflow: hidden; width: 99%;
                                        text-align: center;">
                                        文档名称</div>
                                    <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                        <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                </div>
                            </td>
                            <td align="middle">
                                <div>
                                    <div style="display: inline; float: left; height: auto; overflow: hidden; width: 99%;
                                        text-align: center;">
                                        上传文件名</div>
                                    <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                        <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                </div>
                            </td>
                            <td align="middle">
                                <div>
                                    <div style="display: inline; float: left; height: auto; overflow: hidden; width: 99%;
                                        text-align: center;">
                                        上传者</div>
                                    <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                        <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                </div>
                            </td>
                            <td align="middle">
                                <div>
                                    <div style="display: inline; float: left; height: auto; overflow: hidden; width: 99%;
                                        text-align: center;">
                                        上传时间</div>
                                    <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                        <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                </div>
                            </td>
                        </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr class="data" oid='<%# Eval("DocumentID") %>'>
                    <td>
                        <%#Eval("DocumentName")%>
                    </td>
                    <td>
               <asp:LinkButton ID="lnkbtnDownload" runat="server" Text='<%#Eval("FileName") %>' CommandName="Download" CommandArgument='<%#Eval("FilePath") %>' ></asp:LinkButton>      
                    </td>
                    <td>
                    <%#Eval("CreatedBy")%>
                    </td>
                    <td>
                        <%#Eval("CreatedOn")%>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </tbody> </table>
            </FooterTemplate>
        </asp:Repeater>
        
         <table class="mnubar" cellspacing="0" cellpadding="0" height="400px" style="display:none">
        <tbody>
            <tr>
                <td style="padding-left: 5px" nowrap>
                    <b>上传新文档</b>
                </td>
                <td style="padding-left: 5px">
                    <img src="../Content/Grid/separator.gif">
                </td>
                <td class="icMenu" nowrap>
                </td>
                <td class="icMenu mnuRight" nowrap>
                </td>
            </tr>
        </tbody>
    </table>
     
    <div style="border-bottom: #c2c2bf 1px solid; border-top: #969693 1px solid;display:none;">
    </div>
    
     <div style="display:none;" id="appForm_tab0" class="tab">
     <table style="display:none;">
     <tr><td>文档名称</td><td>
         <asp:TextBox ID="txtDocumentName" runat="server" CssClass="input"></asp:TextBox></td></tr>
     <tr><td>文档路径</td><td>
         <asp:FileUpload ID="fuFilePath" runat="server" /></td></tr>     
     <tr><td colspan="2"><asp:Button ID="btnUpload" runat="server" Text="上传" OnClientClick="return CheckForm();"
             CssClass="button" onclick="btnUpload_Click"/></td></tr>
     </table>
     </div>
</div>
</asp:Content>
